<%@ page language="java" pageEncoding="utf-8"%>
<form action="${ctx }/user/user.action" id="setting_form" method="post">
	<div style="margin: 0; padding: 0; display: inline">
		<input type="hidden" name="user.id" value="${me.id}" />
		<input type="hidden" name="type" value="${param.type}"/>
	</div>
	<fieldset>
		<ul id="password">
			<li><label for="old_password">旧密码</label> <input type="password"
				class="text" id="old_password"
				name="old_password"></li>
			<li><label for="new_password">新密码</label> <input type="password"
				class="text"
				id="new_password" name="new_password">&nbsp;&nbsp;密码长度6~14位，区分大小写
			</li>
			<li><label for="new_password_confirmation">新密码确认</label> <input
				type="password" class="text"
				id="new_password_confirmation" name="new_password_confirmation">
			</li>
			<li>如果您忘记旧的密码或邮件地址，请给管理员发Email：liuzhengqiu1127<img alt="Email"
				src="${ctx}/img/email.gif">163.com ，报告你的帐号ID</li>
		</ul>
	</fieldset>
	<div style="text-align: center;">
		<input id="submit_button" class="submit" name="method:save" type="submit" value="提交" onclick="return beforeSubmit();">
	</div>
</form>
<script type="text/javascript">
$(function(){
	$("#old_password").blur(function(){
		old_password = $("#old_password").val();
		if(old_password.length==0){
			$("#old_password").css("border","3px solid #FF0000"); 
			$("#old_password").attr("title","fail");
			}else{
				$("#old_password").css("border","1px solid #006699");
				$("#old_password").attr("title","succ");
			}
	});
	$("#new_password").blur(function(){
		newpassword = $("#new_password").val();
		if(newpassword.length<6||newpassword.length>14){
			$("#new_password").css("border","3px solid #FF0000");
			$("#new_password").attr("title","fail");
		}else{
			$("#new_password").css("border","1px solid #006699");
			$("#new_password").attr("title","succ");
		}
	});
	$("#new_password_confirmation").blur(function(){
		newpasswordconfirmation = $("#new_password_confirmation").val();
		newpassword = $("#new_password").val();
		if(newpasswordconfirmation.length==0||newpasswordconfirmation!=newpassword){
			$("#new_password_confirmation").css("border","3px solid #FF0000");
			$("#new_password_confirmation").attr("title","fail");
		}else{
			$("#new_password_confirmation").css("border","1px solid #006699");
			$("#new_password_confirmation").attr("title","succ");
		}
	});
});
function beforeSubmit(){
	var test = true;
	$("input[type='password']").each(function(){
		title = $(this).attr("title");
		value = $(this).val();
		if(title=="fail") {
			test = false;
			return false;
		}
		if(value==null||value.length==0){
			test = false;
			return false;
		}
	});
	return test;
}
</script>